﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace SacMauVN
{
    public partial class BangGia : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadBaoGia();
            }
        }

        private void LoadBaoGia()
        {
            string sql = "SELECT m.Ten AS Hang,s.Ma,s.Image,s.Ten,s.GiaTien FROM tblSMVNSanPham s INNER JOIN dbo.tblSMVNMenu m ON s.Menu_ID = m.ID";
            DataTable dt = SqlHelper.ExecuteDataTable(CommandType.Text, sql);
            grvBangGia.DataSource = dt;
            grvBangGia.DataBind();
        }



        protected void grvBangGia_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            grvBangGia.PageIndex = e.NewPageIndex;
            LoadBaoGia();
        }
    }
}
